.TH std::coroutine_handle::promise 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::coroutine_handle::promise \- std::coroutine_handle::promise

.SH Synopsis
   Member of the primary template
   Promise& promise() const;                                              \fI(since C++20)\fP
   Member of specialization
   std::coroutine_handle<std::noop_coroutine_promise>
   std::noop_coroutine_promise& promise() const noexcept;                 \fI(since C++20)\fP

   Obtains a reference to the promise object.

   The behavior is undefined if *this does not refer to a coroutine whose promise
   object has not been destroyed.

   This function is not provided for the specialization std::coroutine_handle<>.

.SH Parameters

   \fI(none)\fP

.SH Return value

   A reference to the promise object.

.SH Notes

   The promise object of a no-op coroutine is not destroyed as long as there is some
   std::noop_coroutine_handle referring to the coroutine.

.SH See also

   from_promise     creates a coroutine_handle from the promise object of a coroutine
   \fB[static]\fP (C++20) \fI(public static member function)\fP
